﻿@model IEnumerable<DynamicQuery.SampleData.Product>
@using DynamicQuery;
@{
    ViewBag.Title = "Product";
}

<h2>Product</h2>
<a href="@Url.Action("Product")">View Paged Version</a>
<div class="container">    
        <form class=".form-search">
            @Html.QueryTextbox("Name", "Product Name", QueryOperator.CONTAINS)
            @Html.QueryTextbox("Category.Name", "Product Category", QueryOperator.CONTAINS)
            @Html.QueryTextbox("Price.1", "Price Between", QueryOperator.GREATEROREQUAL,"decimal")
            @Html.QueryTextbox("Price.2", "", QueryOperator.LESSOREQUAL,"decimal")
            <input type="submit" value="Search" class="btn"/>
        </form>    
</div>
<div class="row">
    <div class="span12 offset2   ">
        <table class="table table-striped">
            <thead>
                <tr>
                    <td>ID</td>
                    <td>Category</td>
                    <td>Name</td>
                    <td>Price</td>
                    <td>Description</td>
                </tr>
            </thead>
            <tbody>
                @foreach (var p in @Model)
                {
                    <tr>
                        <td>@p.Id</td>
                        <td>@p.Category.Name</td>
                        <td>@p.Name</td>
                        <td>@p.Price</td>
                        <td>@p.Description</td>
                    </tr>
                }
            </tbody>
        </table>
    </div>
</div>